<%@ page import="com.itheima.bean.Student" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>查看学生</title>
</head>
<body>
    <table border="1" width="50%" align="center">
        <tr>
            <th>学生编号</th>
            <th>学生姓名</th>
            <th>学生年龄</th>
            <th>学生分数</th>
        </tr>

        <c:forEach var="stu" items="${stus}" varStatus="status">
            <c:if test="${status.count % 2 == 0}">
                <tr align="center" bgcolor="yellow">
                    <td>${status.count}</td>
                    <td>${stu.username}</td>
                    <td>${stu.age}</td>
                    <td>${stu.score}</td>
                </tr>
            </c:if>

            <c:if test="${status.count % 2 != 0}">
                <tr align="center" bgcolor="#ffc0cb">
                    <td>${status.count}</td>
                    <td>${stu.username}</td>
                    <td>${stu.age}</td>
                    <td>${stu.score}</td>
                </tr>
            </c:if>

        </c:forEach>

    </table>
</body>
</html>
